{% extends "orga/generic/list.html" %}

{% load i18n %}

{% block create_button_label %}{% translate "New tag" %}{% endblock create_button_label %}

{% block list_content %}
    <div class="table-responsive-sm">
        <table class="table table-sm table-flip table-sticky">
            <thead>
                <tr>
                    <th>{% translate "Tag" %}</th>
                    <th>{% translate "Color" %}</th>
                    <th class="numeric">{% translate "Proposals" %}</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% for tag in tag_list %}
                    <tr>
                        <td>
                            <a href="{{ tag.urls.edit }}">{{ tag.tag }}</a>
                        </td>
                        <td>
                            <div class="color-square" style="background: {{ tag.color }}"></div>
                        </td>
                        <td class="numeric">{{ tag.submissions.all.count }}</td>
                        <td class="text-right">
                            {% if has_update_permission %}
                                <a href="{{ tag.urls.edit }}" class="btn btn-sm btn-info">
                                    <i class="fa fa-edit"></i>
                                </a>
                            {% endif %}
                            {% if has_delete_permission %}
                                <a href="{{ tag.urls.delete }}" class="btn btn-sm btn-danger">
                                    <i class="fa fa-trash"></i>
                                </a>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    {% include "orga/includes/pagination.html" %}

{% endblock list_content %}
